#!/usr/bin/python3
# -*- coding:utf-8 -*-
""""
   @Author: 即将拥有人鱼线的yjw
   @Time: 2024/12/5 16:35
   @File: agencyClient.py
   @desc:
"""
from random import choice
from faker import Faker
from DataTest.tabledata.commonData import randomInfo


fake = Faker(locale='zh_CN')

def get_agency_client():
    '''
    客户名称、
    住所、
    经营范围、
    组织机构代码、
    税务登记证号码；
    可证明该客户依法设立或者可依法开展经营、社会活动的执照、证件或者文件的名称、
    号码和
    有效期限；
    控股股东或者实际控制人、
    法定代表人、
    负责人和授权办理业务人员的姓名、
    身份证件或者身份证明文件的种类、
    号码、
    有效期限。
    :return:
    '''
    name = fake.company()
    phone = fake.phone_number()
    addList = fake.address().split(' ')
    transactor_person = random_client()#经办人
    actual_person = random_client()#实际控制人
    ctrl_person = random_client()#控股股东
    legp_person = random_client()#法人
    benefit_person = random_client()#受益所有人
    dict_entries = {
        'client_name': name,
        'client_full_name': name,
        'client_type': '1',
        'nationality_code': 'CHN',
        'gender_code': '',
        'education_code': '',
        'id_no': randomInfo.random_credit_code(),
        'birth_date': 0,
        'id_type':'24',
        'id_address': fake.address().split(' ')[0],
        'contact_address':addList[0],
        'email_address':addList[0],
        'work_unit_address':addList[0],
        'zip_code':addList[1],
        'cellphone_number':phone,
        'telephone_number':phone,
        'register_capital':randomInfo.get_random_int(8), #注册资本
        'register_country_code':'CHN',#注册国家
        'occupation_code': 'J0000',#行业,默认金融业
        'register_capital_currency': 'CNY',  # 注册资金币种代码CNY、USD、HKD
        'register_address': '开曼群岛',  # 注册地址
        'id_end_date':randomInfo.get_overdue_date(),
        'transactor_name': transactor_person['name'],
        'transactor_id_type': transactor_person['id_type'],
        'transactor_id_no': transactor_person['id_no'],
        'transactor_id_end_date': transactor_person['id_end_date'],
        'transactor_nationality_code':'CHN',
        'actual_control_name':actual_person['name'],
        'actual_control_id_type':actual_person['id_type'],
        'actual_control_id_no': actual_person['id_no'],
        'actual_control_id_end_date': actual_person['id_end_date'],
        'ctrl_shareholder_name': ctrl_person['name'],
        'ctrl_shareholder_id_no': ctrl_person['id_no'],
        'ctrl_shareholder_id_type': ctrl_person['id_type'],
        'ctrl_shareholder_type': '',
        'ctrl_shareholder_id_end_date': ctrl_person['id_end_date'],
        'legp_name': legp_person['name'],
        'legp_id_type': legp_person['id_type'],
        'legp_id_no': legp_person['id_no'],
        'legp_id_end_date': legp_person['id_end_date'],
        'benefit_name': benefit_person['name'],
        'benefit_id_type': benefit_person['id_type'],
        'benefit_id_no': benefit_person['id_no'],
        'benefit_id_end_date': benefit_person['id_end_date'],
        'benefit_id':'',
        'bank_name': name
    }
    print(dict_entries)
    return dict_entries

def random_client():
    dict_entries = {
        'name': fake.name(),
        'id_no': fake.ssn(),
        'id_type': '1',
        'id_end_date':randomInfo.get_overdue_date()
    }
    return dict_entries

if __name__=='__main__':
    # addrList = fake.address()
    # print(addrList)
    get_agency_client()